package com.exam.consumer;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class DelayConsumer {
    public static final String DEAD_LETTER_QUEUE_NAME = "dead_letter_queue";

    @RabbitListener(queues = DEAD_LETTER_QUEUE_NAME)
    public void delay(String msg) {
        System.out.println("延迟队列消费者消费消息：" + msg + "，时间：" + new Date());
    }
}
